#ifndef UICONTROLLER_H
#define UICONTROLLER_H

#include <QObject>
#include "ShareMemory/queuesharememory.h"
#include "BuildingMapModel/buildingmapmodel.h"
#include <QQmlApplicationEngine>
#include "database.h"
#include "sdcontroller.h"
#include "spcontroller.h"

class UIController : public QObject
{
    Q_OBJECT
public:
    explicit UIController(QObject *parent = nullptr);

signals:
    void rootWinEvent(QString cmd , QVariant pars);
public slots:
    QVariant getMcConfigInfo(QString groupname , QString keyname);
private:
    QQmlApplicationEngine engine;
    QueueShareMemory *mpGuiSHM;

    BuildingMapModel *mp_SDBuildModel;
    BuildingMapModel *mp_SPBuildModel;

    QTimer mt_ReadSHMTimer;
    QQueue<QByteArray>mq_SHMData;
    SDController *mp_SDController;
    SPController *mp_SPController;
    void readSHMTimerEvent();


    void processData(QByteArray data);



};

#endif // UICONTROLLER_H
